#e
#Title[iʏ`Easy]
#Text[ȒPłB̂[O܂B]
#ScriptVersion[2]

script_enemy_main {
 let img = "script\img\ExRumia.png";
 let frame     =  0;
 let angleBase = 90;

 @Initialize {
  SetX(GetCenterX);
  SetY(GetCenterY - 120);
  SetLife(3000);
  SetTimer(99);

  LoadGraphic(img);
  SetTexture(img);
  SetGraphicRect(64, 0, 128, 64);

  TMain;
 }

 @MainLoop {
  SetCollisionA(GetX, GetY, 24);
  SetCollisionB(GetX, GetY, 24);

  yield;
 }

 @DrawLoop {
  DrawGraphic(GetX, GetY);
 }

 @Finalize {
  DeleteGraphic(img);
 }

 //ȉ^XN(}CNXbh)

 task TMain {
  yield;

  TMove;
  TShot;
  TShot2; //Ă
  TShot3; 
 
  
 }

 task TMove {
  yield;
 }

 task TShot {

 SetShotDirectionType(PLAYER);

  let angle = 0;
  let xMove = 1;
  let pet = 0;
  yield;

  loop {
   loop(5) { yield; }
   CreateShot01(GetX - xMove, GetY+90, 3, angle, ORANGE22, 90);
   angle += 16.5;

   pet += 1;
   if(pet < 200) {
    xMove += 1;
   }
   if(pet >= 200) {
    xMove -= 1;
   }
   if(pet > 400) {
    pet = 0;
   }
  }
 }

 task TShot2 {

 SetShotDirectionType(PLAYER);

  let angle = 0;
  let xMove = 1;
  let pet = 0;
  yield;

  loop {
   loop(5) { yield; }
   CreateShot01(GetX + xMove, GetY+90, 3, angle, ORANGE22, 90);
   angle -= 16.5;

   pet += 1;
   if(pet < 200) {
    xMove += 1;
   }
   if(pet >= 200) {
    xMove -= 1;
   }
   if(pet > 400) {
    pet = 0;
   }
  }
 }

task TShot3 {
      
   SetShotDirectionType(PLAYER);

   let angle = 0;
  
  yield;

  loop {
   loop(5) { yield; }
   CreateShot01(GetX , GetY-90, 3, angle, ORANGE03, 90);
   angle -= 15;

   
   }
  }
 }



 function wait(w) {
  loop(w) { yield; }
  
 
}

}